﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B2
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入数组长度");
            string input = Console.ReadLine();
            int len = int.Parse(input);
            int[] a = new int[len];
            Console.WriteLine("请输入数据，回车键分割");
            for (int i = 0; i < len; i++)
            {
                input = Console.ReadLine();
                a[i] = int.Parse(input);
            }
            int sum = a[0];int max = a[0]; int min = a[0];
            for(int i = 1; i < len; i++)
            {
                if (a[i] < min) { min = a[i]; }
                if (a[i] > max) { max = a[i]; }
                sum += a[i];
            }
            Console.WriteLine("最小值是：" + min.ToString());
            Console.WriteLine("最大值是：" + max.ToString());
            Console.WriteLine("和是：" + sum.ToString());
            Console.WriteLine("平均值是：" + (sum*1.0/len).ToString());
            //Console.ReadLine();
        }
    }
}
